package com.sq.partner.manager.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.sq.partner.manager.dao.SchoolConfigDao;
import com.sq.partner.manager.mybatis.model.DictDto;
import com.sq.partner.manager.util.LogUtil;
import com.sq.partner.manager.util.Page;

@Repository
public class SchoolConfigDaoImpl extends BaseDaoImpl implements
		SchoolConfigDao {
	
	private static Logger logger = LogUtil.getLog(DictManagerDaoImpl.class);

	@Override
	public List<Map<String, Object>> queryDictByParameter(Map<String, Object> paramMap) throws Exception {
		return this.queryList("queryDictByParameter", paramMap);
	}

	@Override
	public Page<DictDto> queryDictDtoPageByCriteria(Page<DictDto> page) throws Exception {
		Map<String, Object> map=page.getMap();
		Long count=(Long) this.query("querySchoolConfigCount", map);
		logger.debug("查询结果总条数 ： " + count);
		page.setTotal(count);
		@SuppressWarnings("unchecked")
		List<DictDto> dicts=this.queryList("querySchoolConfigList", map);
		page.setData(dicts);
		return page;
	}

	@Override
	public List<Map<String, Object>> querySchoolConfigSelect(
			Map<String, Object> map) throws Exception {
		return this.queryList("querySchoolConfigSelect", map);
	}

	@Override
	public void updateSchoolConfig(DictDto dict) throws Exception {
		this.queryList("updateSchoolConfig", dict);
	}

}
